import 'package:flutter/material.dart';

void main(List<String> args) {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          body: DefaultTabController(
        length: 2,
        child: Column(children: [
          Container(
            height: 50,
          ),
          const TabBar(labelColor: Colors.blue, tabs: [
            Tab(
              text: 'tab1',
            ),
            Tab(text: 'tab2')
          ]),
          Expanded(
              child: TabBarView(
            children: [
              ListView.builder(
                key: const PageStorageKey(1),
                itemExtent: 100,
                itemCount: 100,
                itemBuilder: (context, index) => Text('list1 -- $index'),
              ),
              ListView.builder(
                itemExtent: 100,
                itemCount: 200,
                itemBuilder: (context, index) => Text('list2 -- $index'),
              ),
            ],
          ))
        ]),
      )),
    );
  }
}
